home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / ifl / iflLut.z / iflLut
Encoding:
Text File  |  1998-10-20  |  14.9 KB  |  397 lines

  1.  
  2.  
  3.  
  4. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiiffffllllLLLLuuuutttt - base class for defining look-up tables
  10.  
  11.  
  12. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  13.      This is a base class with no inheritance.
  14.  
  15.  
  16. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  17.      #include <il/iflLut.h>
  18.  
  19.  
  20. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      iflLut is a base class used for accessing and manipulating look-up
  22.      tables. The class definition provides the necessary data structure for
  23.      defining and accessing the look-up table.
  24.  
  25.      A look-up table is defined by the number of channels, the range of input
  26.      values it expects (the domain), the data type, and the actual look-up
  27.      table data.  There is a table for each channel and the size and data type
  28.      of each table is the same.  The look-up table data is stored in
  29.      iflSequential format. In other words, the table for each channel is
  30.      stored contiguously.  The tables for each channel are packed together
  31.      into a single array.
  32.  
  33.    UUUUssssiiiinnnngggg iiiiffffllllLLLLuuuutttt
  34.      The iflLut object can either be used to allocate a look-up table whose
  35.      values are filled in by calls to the sssseeeettttVVVVaaaallll() function, or it can be used
  36.      to wrap an object definition around an existing array of lut values.
  37.      Constructors are provided for both of these usages.  When the iflLut
  38.      allocates the tables, it frees them when it is deleted.  If the tables
  39.      are passed to the constructor, then the caller is responsible for the
  40.      management of the table memory.  Once an iflLut is constructed, its table
  41.      can be completely replaced using the sssseeeettttDDDDaaaattttaaaa() function, or it can be
  42.      modified an entry at a time with sssseeeettttVVVVaaaallll().
  43.  
  44.      The values in the lut can be accesed by getting a pointer to the table
  45.      with ggggeeeettttDDDDaaaattttaaaa(), ggggeeeettttCCCChhhhaaaannnn() or ggggeeeettttOOOOrrrriiiiggggiiiinnnn().  The pointer returned must be
  46.      cast to match the internal type of the table as returned by
  47.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee().  Alternatively, individual entries in the table can be
  48.      accesed using the ggggeeeettttVVVVaaaallll() function.  While less efficient, this function
  49.      is easier to use since ggggeeeettttVVVVaaaallll() automatically converts to double so that
  50.      the data type of the table can be ignored. It also automatically deals
  51.      with and scaling necessary to deal with a domain that is not a one to one
  52.      mapping onto the number of entries in the look up tables.
  53.  
  54.      The range of values contained in the tables can be interrogated by
  55.      ggggeeeettttRRRRaaaannnnggggeeee(((()))).  The range of values the lut expects as input can be accessed
  56.      with ggggeeeettttDDDDoooommmmaaaaiiiinnnn().
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  71.  
  72.  
  73.  
  74. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  75.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  76.  
  77.           iflLut()
  78.           iflLut(int numChan, iflDataType dtype, double min, double max,
  79.                  int length=0)
  80.           iflLut(void* table, int numChan, iflDataType dtype, double min,
  81.                  double max, int length=0)
  82.           iflLut(const iflLut& other)
  83.  
  84.      BBBBaaaassssiiiicccc aaaattttttttrrrriiiibbbbuuuutttteeeessss
  85.  
  86.           int getNumChans()
  87.           iflDataType getDataType()
  88.           int getLength()
  89.  
  90.      EEEEnnnnttttrrrryyyy aaaacccccccceeeessssssss
  91.  
  92.           double getVal(double domainIdx, int chan=0)
  93.           iflStatus setVal(double val, double domainIdx, int chan=0)
  94.  
  95.      DDDDiiiirrrreeeecccctttt ttttaaaabbbblllleeee aaaacccccccceeeessssssss
  96.  
  97.           void* getOrigin(int chan)
  98.           void* getChan(int chan)
  99.           void* getData()
  100.           void setData(void* dataPnt)
  101.  
  102.      DDDDoooommmmaaaaiiiinnnn aaaannnndddd rrrraaaannnnggggeeee ccccoooonnnnttttrrrroooollll
  103.  
  104.           void getDomain(double& min, double& max)
  105.           double getDomainMin()
  106.           double getDomainMax()
  107.           double getDomainStep()
  108.           void getRange(double& min, double& max)
  109.           iflStatus setDomain(double min, double max)
  110.  
  111.      CCCCoooommmmppppaaaarrrriiiissssoooonnnn
  112.  
  113.           int isDiff(const iflLut& from)
  114.  
  115.      IIIInnnniiiittttiiiiaaaalllliiiizzzzaaaattttiiiioooonnnn
  116.  
  117.           void operator=(const iflLut& from)
  118.           void init(void* table, int tabChannels, iflDataType tabType,
  119.                     double min, double max, int length=0)   _p_r_o_t_e_c_t_e_d
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  137.  
  138.  
  139.  
  140. FUNCTION DESCRIPTIONS
  141.      iiiiffffllllLLLLuuuutttt(((())))
  142.  
  143.           iflLut()
  144.           iflLut(const iflLut& other)
  145.           iflLut(int numChan, iflDataType dtype, double min, double max,
  146.                  int length=0)
  147.           iflLut(void* table, int numChan, iflDataType dtype, double min,
  148.                  double max, int length=0)
  149.  
  150.  
  151.           Constructors for the iflLut class.  The number of tables or channels
  152.           in the lut is specified by _n_u_m_C_h_a_n and the LUT data type is
  153.           specified by _d_t_y_p_e.  The domain of values the table handles is from
  154.           _m_i_n to _m_a_x.  The length of each table is either _m_a_x-_m_i_n+1 if _l_e_n_g_t_h
  155.           is 0, otherwise it is given by _l_e_n_g_t_h.  A constructor is also
  156.           provided that creates an iflLut whose look-up table data is  pointed
  157.           to by _t_a_b_l_e. Another constructor is provided that copies the tables
  158.           and attributes from the iflLut specified by _o_t_h_e_r into this object
  159.           The default constructor generates an empty iiiiffffllllLLLLuuuutttt.  This can be
  160.           useful in conjuction with the assigment operator.
  161.  
  162.      ggggeeeettttCCCChhhhaaaannnn(((())))
  163.  
  164.           void* getChan(int chan)
  165.  
  166.  
  167.           Returns a pointer to the beginning of the table for channel number
  168.           _c_h_a_n.
  169.  
  170.      ggggeeeettttDDDDaaaattttaaaa(((())))
  171.  
  172.           void* getData()
  173.  
  174.  
  175.           Returns a pointer to the overall beginning of the tables for all
  176.           channels.  If returns the same value as ggggeeeettttCCCChhhhaaaannnn(0).
  177.  
  178.      ggggeeeettttDDDDaaaattttaaaaTTTTyyyyppppeeee(((())))
  179.  
  180.           iflDataType getDataType()
  181.  
  182.  
  183.           Returns the data type of the entries in the look-up table.
  184.  
  185.      ggggeeeettttDDDDoooommmmaaaaiiiinnnn(((())))
  186.  
  187.           void getDomain(double& min, double& max)
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  203.  
  204.  
  205.  
  206.           Returns the domain, in _m_i_n and _m_a_x, that the look-up table handles
  207.           as input.
  208.  
  209.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnMMMMaaaaxxxx(((())))
  210.  
  211.           double getDomainMax()
  212.  
  213.  
  214.           Returns the maximum value that the look-up table handles as input.
  215.  
  216.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnMMMMiiiinnnn(((())))
  217.  
  218.           double getDomainMin()
  219.  
  220.  
  221.           Returns the minimum value that the look-up table handles as input.
  222.  
  223.      ggggeeeettttDDDDoooommmmaaaaiiiinnnnSSSStttteeeepppp(((())))
  224.  
  225.           double getDomainStep()
  226.  
  227.  
  228.           Returns the incremental step in the domain space between adjacent
  229.           entries in the look-up table.
  230.  
  231.      ggggeeeettttLLLLeeeennnnggggtttthhhh(((())))
  232.  
  233.           int getLength()
  234.  
  235.  
  236.           Returns the length of a table for an individual channel.
  237.  
  238.      ggggeeeettttNNNNuuuummmmCCCChhhhaaaannnnssss(((())))
  239.  
  240.           int getNumChans()
  241.  
  242.  
  243.           Returns the number of channels in the look-up table.
  244.  
  245.      ggggeeeettttOOOOrrrriiiiggggiiiinnnn(((())))
  246.  
  247.           void* getOrigin(int chan)
  248.  
  249.  
  250.           Returns a pointer to the entry for value zero of the table for
  251.           channel number _c_h_a_n.
  252.  
  253.      ggggeeeettttRRRRaaaannnnggggeeee(((())))
  254.  
  255.           void getRange(double& min, double& max)
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  269.  
  270.  
  271.  
  272.           Returns the range of values that the look-up table contains in _m_i_n
  273.           and _m_a_x.
  274.  
  275.      ggggeeeettttVVVVaaaallll(((())))
  276.  
  277.           double getVal(double domainIdx, int chan=0)
  278.  
  279.  
  280.           Returns the look-up table entry for channel, _c_h_a_n, and input value,
  281.           _d_o_m_a_i_n_i_d_x.  The domain index is scaled as needed to map onto the
  282.           actual table entries when the table length does not map one to one
  283.           onto the domain.
  284.  
  285.      iiiinnnniiiitttt(((())))
  286.  
  287.           void init(void* table, int tabChannels, iflDataType tabType,
  288.                     double min, double max, int length=0)   _p_r_o_t_e_c_t_e_d
  289.  
  290.  
  291.           This method fully initializes this object with the specified
  292.           attributes, the interpreation of the parameters is the same as for
  293.           the constructors.
  294.  
  295.      iiiissssDDDDiiiiffffffff(((())))
  296.  
  297.           int isDiff(const iflLut& from)
  298.  
  299.  
  300.           The method returns TRUE if the the this lut is not identical, in
  301.           attributes and tables contents, to the lut specified by _f_r_o_m; FALSE
  302.           is returned if the luts are the same.
  303.  
  304.      ooooppppeeeerrrraaaattttoooorrrr====(((())))
  305.  
  306.           void operator=(const iflLut& from)
  307.  
  308.  
  309.           This function makes a copy of the look-up table (including all of
  310.           its tables) specified by _f_r_o_m.
  311.  
  312.      sssseeeettttDDDDaaaattttaaaa(((())))
  313.  
  314.           void setData(void* dataPnt)
  315.  
  316.  
  317.           This function replaces the array of all the tables in the lut with
  318.           the data pointed to be _d_a_t_a.  The array of data is not copied, nor
  319.           is it deallocated when the iflLut is deleted.  The format of the
  320.           data must match the data type, length, and number of channels in the
  321.           iflLut.  See the Class Description section for details on the layout
  322.           of the look-up table data.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. iiiiffffllllLLLLuuuutttt((((3333))))         IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll          iiiiffffllllLLLLuuuutttt((((3333))))
  335.  
  336.  
  337.  
  338.      sssseeeettttDDDDoooommmmaaaaiiiinnnn(((())))
  339.  
  340.           iflStatus setDomain(double min, double max)
  341.  
  342.  
  343.           Sets the range of values that this lut expects to _m_i_n and _m_a_x.  If
  344.           _m_a_x-_m_i_n+1 exceeds the current length of the table, a status of
  345.           iflBADPARAMS is returned; iflOKAY is returned if the operation is
  346.           successful.
  347.  
  348.      sssseeeettttVVVVaaaallll(((())))
  349.  
  350.           iflStatus setVal(double val, double domainIdx, int chan=0)
  351.  
  352.  
  353.           This function sets the look-up table entry for channel, _c_h_a_n, and
  354.           input value, _d_o_m_a_i_n_i_d_x.  The value given by _v_a_l is converted to the
  355.           internal data type of the table.  If the entry indicated is not
  356.           contained in the iflLut, a value of iflBADPARAMS is returned;
  357.           iflOKAY is returned if the operation is successful.  The domain
  358.           index is scaled as needed to map onto the actual table entries when
  359.           the table length does not map one to one onto the domain.
  360.  
  361. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  362.      iflColormap, iflSGIColormap
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.